home *** CD-ROM | disk | FTP | other *** search
/ NetObjects Fusion 7 / Fusion7.iso / NetObjects Fusion / data1.cab / Language_Resource_-_English / Components / DynaButtons / DynaButtons.jar / DynaButtonsComp / DynaButtonsComp.class (.txt) < prev   
Encoding:
Java Class File  |  2000-10-30  |  14.4 KB  |  607 lines

  1. package DynaButtonsComp;
  2.  
  3. import com.netobjects.nfc.api.CStringArray;
  4. import com.netobjects.nfc.api.ComponentApp;
  5. import com.netobjects.nfc.api.DAssetManager;
  6. import com.netobjects.nfc.api.DDrawJava;
  7. import com.netobjects.nfc.api.DFont;
  8. import com.netobjects.nfc.api.DLayout;
  9. import com.netobjects.nfc.api.DRect;
  10. import com.netobjects.nfc.api.DSite;
  11. import com.netobjects.nfc.api.DSize;
  12. import com.netobjects.nfc.api.DStyle;
  13. import com.netobjects.nfc.api.IDInspector;
  14. import java.util.ResourceBundle;
  15.  
  16. public class DynaButtonsComp extends ComponentApp {
  17.    int backgroundStyle = 0;
  18.    DAssetManager assMan = null;
  19.    int upID = 0;
  20.    int downID = 0;
  21.    int backID = 0;
  22.    String Orientation = "";
  23.    String ButtonImage = "";
  24.    String HighliteImage = "";
  25.    String paramButtonImage = "";
  26.    String paramHighliteImage = "";
  27.    int backgroundColor = 0;
  28.    String backgroundImage = "";
  29.    String paramBackgroundImage = "";
  30.    int textJustification = 0;
  31.    int textAlignment = 0;
  32.    int fontColor = 0;
  33.    int highliteFontColor = 0;
  34.    String buttonFont = "";
  35.    boolean italic = false;
  36.    boolean bold = false;
  37.    int fontSize = 0;
  38.    ButtonObject buttonList = null;
  39.    DDrawJava theJavaApplet = null;
  40.    String compImage = "";
  41.    int imgX = 0;
  42.    int imgY = 0;
  43.    String indent = "    ";
  44.    // $FF: renamed from: cb java.lang.String
  45.    String field_0;
  46.  
  47.    void checkList(ButtonObject list) {
  48.    }
  49.  
  50.    protected void CopyOneAsset(String assetIDStr) {
  51.       int assetID = Integer.parseInt(assetIDStr, 10);
  52.       if (assetID != 0) {
  53.          this.assMan.CopyAsset(assetID);
  54.       }
  55.  
  56.    }
  57.  
  58.    private int countButtons(ButtonObject buttonList) {
  59.       int num = 0;
  60.  
  61.       for(ButtonObject tempList = buttonList.getNext(); tempList != null; tempList = tempList.getNext()) {
  62.          ++num;
  63.       }
  64.  
  65.       return num;
  66.    }
  67.  
  68.    private void debug(String out) {
  69.    }
  70.  
  71.    private void modifyImageSize() {
  72.       int width = 0;
  73.       int height = 0;
  74.       ButtonObject tempList = this.buttonList.getNext();
  75.       if (this.Orientation.compareTo(ResourceBundle.getBundle("DynaButtonsComp").getString("Horizontal")) == 0) {
  76.          for(width = this.countButtons(this.buttonList); tempList != null; tempList = tempList.getNext()) {
  77.             if (height == 0) {
  78.                height = 1;
  79.             }
  80.  
  81.             if (tempList.getSubButtonsExist()) {
  82.                int numSubButtons = this.countButtons(tempList.getSubButtons()) + 1;
  83.                if (numSubButtons > height) {
  84.                   height = numSubButtons;
  85.                }
  86.             }
  87.          }
  88.       } else {
  89.          height = this.countButtons(this.buttonList);
  90.  
  91.          for(int i = 1; tempList != null; ++i) {
  92.             if (width == 0) {
  93.                width = 1;
  94.             }
  95.  
  96.             if (tempList.getSubButtonsExist()) {
  97.                width = 2;
  98.                int numSubButtons = this.countButtons(tempList.getSubButtons()) + i;
  99.                if (numSubButtons > height) {
  100.                   height = numSubButtons;
  101.                }
  102.             }
  103.  
  104.             tempList = tempList.getNext();
  105.          }
  106.       }
  107.  
  108.       this.theJavaApplet.SetSize(width * this.imgX, height * this.imgY);
  109.    }
  110.  
  111.    private void modifyNumButtons(int newLength, ButtonObject currentList) {
  112.       int currentLength = this.countButtons(currentList);
  113.       if (newLength < currentLength) {
  114.          for(int i = 0; i < newLength; ++i) {
  115.             currentList = currentList.getNext();
  116.          }
  117.  
  118.          currentList.setNext((ButtonObject)null);
  119.       } else if (newLength > currentLength) {
  120.          for(int i = 0; i < newLength; ++i) {
  121.             if (currentList.getNext() == null) {
  122.                currentList.setNext(new ButtonObject());
  123.             }
  124.  
  125.             currentList = currentList.getNext();
  126.          }
  127.       }
  128.  
  129.    }
  130.  
  131.    public void onCopy() {
  132.       this.debug("in onCopy()");
  133.       this.Orientation = new String(this.Orientation);
  134.       this.ButtonImage = new String(this.ButtonImage);
  135.       this.HighliteImage = new String(this.HighliteImage);
  136.       this.paramButtonImage = new String(this.paramButtonImage);
  137.       this.paramHighliteImage = new String(this.paramHighliteImage);
  138.       this.backgroundImage = new String(this.backgroundImage);
  139.       this.buttonFont = new String(this.buttonFont);
  140.       this.compImage = new String(this.compImage);
  141.       this.indent = new String(this.indent);
  142.       this.assMan.CopyAsset(this.upID);
  143.       this.assMan.CopyAsset(this.downID);
  144.       ButtonObject copyButtonList = new ButtonObject();
  145.       ButtonObject copyTempList = copyButtonList;
  146.       this.debug("<copy> length of original: " + this.countButtons(this.buttonList));
  147.       ButtonObject tempList = this.buttonList.getNext();
  148.       this.debug("about to copy list");
  149.  
  150.       for(int i = 1; tempList != null; ++i) {
  151.          this.debug("in copy list");
  152.          copyTempList.setNext(new ButtonObject());
  153.          copyTempList = copyTempList.getNext();
  154.          this.CopyOneAsset(tempList.getID());
  155.          copyTempList.setID(tempList.getID());
  156.          copyTempList.setText(tempList.getText());
  157.          copyTempList.setURL(tempList.getURL());
  158.          this.debug("copied: " + i);
  159.          if (tempList.getSubButtonsExist()) {
  160.             copyTempList.setSubButtonsExist(true);
  161.             ButtonObject subList = tempList.getSubButtons().getNext();
  162.             ButtonObject copySubList = copyTempList.getSubButtons();
  163.  
  164.             for(int j = 1; subList != null; ++j) {
  165.                copySubList.setNext(new ButtonObject());
  166.                copySubList = copySubList.getNext();
  167.                this.CopyOneAsset(subList.getID());
  168.                copySubList.setID(subList.getID());
  169.                copySubList.setText(subList.getText());
  170.                copySubList.setURL(subList.getURL());
  171.                subList = subList.getNext();
  172.             }
  173.          }
  174.  
  175.          tempList = tempList.getNext();
  176.       }
  177.  
  178.       this.buttonList = copyButtonList;
  179.    }
  180.  
  181.    public void onDrop(DLayout layout, DRect r, int fDrop) {
  182.       if (fDrop == 1) {
  183.          this.theJavaApplet = new DDrawJava();
  184.          this.field_0 = this.theJavaApplet.getCodeBase();
  185.          this.compImage = this.field_0 + "DYNBUTTON.gif";
  186.          this.theJavaApplet.SetStyle(1, 1);
  187.          this.theJavaApplet.setStretch(2);
  188.          this.buttonList = new ButtonObject();
  189.          this.buttonList.setNext(new ButtonObject());
  190.          this.theJavaApplet.setImageFile(this.compImage);
  191.          this.theJavaApplet.setUsePictureText(true);
  192.          this.theJavaApplet.setPictureText(ResourceBundle.getBundle("DynaButtonsComp").getString("Component_Name"));
  193.          DSite site = layout.getSite();
  194.          DStyle style = site.getCurrentStyle();
  195.          DSize buttonSize = style.getButtonSize();
  196.          int imX;
  197.          int imY;
  198.          if (buttonSize != null) {
  199.             imX = buttonSize.getWidth();
  200.             imY = buttonSize.getHeight();
  201.          } else {
  202.             imX = 100;
  203.             imY = 35;
  204.          }
  205.  
  206.          this.theJavaApplet.SetPositionRect(r.getLeft(), r.getTop(), r.getLeft() + imX, r.getTop() + imY);
  207.          this.Orientation = ResourceBundle.getBundle("DynaButtonsComp").getString("Horizontal");
  208.          this.theJavaApplet.setAppletFileName(this.field_0 + "DynaButtons.class");
  209.          this.theJavaApplet.AddAdditionalAppletFile(this.field_0 + "PopButton.class");
  210.          this.theJavaApplet.AddAdditionalAppletFile(this.field_0 + "PopObject.class");
  211.          this.theJavaApplet.AddAdditionalAppletFile(this.field_0 + "DynaButtons.zip");
  212.          layout.AddObject(this.theJavaApplet);
  213.       }
  214.  
  215.       if (fDrop != 3 && fDrop != 4) {
  216.          this.updateSiteLook(0);
  217.          this.SetPropertyValues();
  218.       }
  219.  
  220.    }
  221.  
  222.    protected void onFinalize() {
  223.       this.RemoveAssets();
  224.       ButtonObject tempList = this.buttonList.getNext();
  225.  
  226.       for(int i = 1; tempList != null; ++i) {
  227.          this.RemoveOneAsset(tempList.getID());
  228.          if (tempList.getSubButtonsExist()) {
  229.             ButtonObject subList = tempList.getSubButtons().getNext();
  230.  
  231.             for(int j = 1; subList != null; ++j) {
  232.                this.RemoveOneAsset(subList.getID());
  233.                subList = subList.getNext();
  234.             }
  235.          }
  236.  
  237.          tempList = tempList.getNext();
  238.       }
  239.  
  240.    }
  241.  
  242.    public void onInspect(CStringArray Names, CStringArray Types) {
  243.       Names.Set(ResourceBundle.getBundle("DynaButtonsComp").getString("Orientation"));
  244.       Types.Set("Set(" + ResourceBundle.getBundle("DynaButtonsComp").getString("Orientation_List") + ")");
  245.       Names.Set(ResourceBundle.getBundle("DynaButtonsComp").getString("Number_of_Buttons"));
  246.       Types.Set("Collection");
  247.       ButtonObject tempList = this.buttonList.getNext();
  248.  
  249.       for(int i = 1; tempList != null; ++i) {
  250.          if (tempList.getSubButtonsExist()) {
  251.             Names.Set(ResourceBundle.getBundle("DynaButtonsComp").getString("Button") + " " + i);
  252.             Types.Set("String");
  253.             Names.Set(ResourceBundle.getBundle("DynaButtonsComp").getString("Use_Sub_Buttons") + " " + i);
  254.             Types.Set("Set(" + ResourceBundle.getBundle("DynaButtonsComp").getString("Use_Sub_Button_List") + ")");
  255.             Names.Set(ResourceBundle.getBundle("DynaButtonsComp").getString("Number_Sub_Buttons") + " " + i);
  256.             Types.Set("Collection");
  257.             ButtonObject subList = tempList.getSubButtons().getNext();
  258.  
  259.             for(int j = 1; subList != null; ++j) {
  260.                Names.Set(this.indent + ResourceBundle.getBundle("DynaButtonsComp").getString("Sub_Button") + " " + i + "," + j);
  261.                Types.Set("Link");
  262.                subList = subList.getNext();
  263.             }
  264.          } else {
  265.             Names.Set(ResourceBundle.getBundle("DynaButtonsComp").getString("Button") + " " + i);
  266.             Types.Set("Link");
  267.             Names.Set(ResourceBundle.getBundle("DynaButtonsComp").getString("Use_Sub_Buttons") + " " + i);
  268.             Types.Set("Set(" + ResourceBundle.getBundle("DynaButtonsComp").getString("Use_Sub_Button_List") + ")");
  269.          }
  270.  
  271.          tempList = tempList.getNext();
  272.       }
  273.  
  274.    }
  275.  
  276.    public String onInstall(DAssetManager cam, String codebase) {
  277.       this.assMan = cam;
  278.       this.compImage = codebase + "DYNBUTTON.gif";
  279.       return ResourceBundle.getBundle("DynaButtonsComp").getString("Component_Name");
  280.    }
  281.  
  282.    public void onPublish(DAssetManager asm, int context) {
  283.       this.updateSiteLook(context);
  284.       this.setAllUrls(context);
  285.       if (context == 1) {
  286.          this.paramButtonImage = this.ButtonImage;
  287.          this.paramHighliteImage = this.HighliteImage;
  288.          this.paramBackgroundImage = this.backgroundImage;
  289.       } else {
  290.          this.paramButtonImage = this.ButtonImage;
  291.          this.paramHighliteImage = this.HighliteImage;
  292.          this.paramBackgroundImage = this.backgroundImage;
  293.       }
  294.  
  295.       this.SetPropertyValues();
  296.       DRect thePosition = this.theJavaApplet.getObjectRect();
  297.       this.theJavaApplet.AddParam("X Position", "String", Integer.toString(thePosition.getLeft()));
  298.       this.theJavaApplet.AddParam("Y Position", "String", Integer.toString(thePosition.getTop() + 7));
  299.    }
  300.  
  301.    public String PropertyListener(String Event, String Value, int Get, int propIndex, IDInspector insp) {
  302.       if (Get == 1) {
  303.          if (Event.compareTo(ResourceBundle.getBundle("DynaButtonsComp").getString("Orientation")) == 0) {
  304.             if (this.Orientation.compareTo(ResourceBundle.getBundle("DynaButtonsComp").getString("Horizontal")) == 0) {
  305.                return "0";
  306.             }
  307.  
  308.             return "1";
  309.          }
  310.  
  311.          if (Event.compareTo(ResourceBundle.getBundle("DynaButtonsComp").getString("Number_of_Buttons")) == 0) {
  312.             return Integer.toString(this.countButtons(this.buttonList));
  313.          }
  314.  
  315.          ButtonObject tempList = this.buttonList.getNext();
  316.  
  317.          for(int i = 1; tempList != null; ++i) {
  318.             if (Event.compareTo(ResourceBundle.getBundle("DynaButtonsComp").getString("Use_Sub_Buttons") + " " + i) == 0) {
  319.                if (tempList.getSubButtonsExist()) {
  320.                   return "0";
  321.                }
  322.  
  323.                return "1";
  324.             }
  325.  
  326.             if (Event.compareTo(ResourceBundle.getBundle("DynaButtonsComp").getString("Button") + " " + i) == 0) {
  327.                if (tempList.getSubButtonsExist()) {
  328.                   return tempList.getText();
  329.                }
  330.  
  331.                return tempList.getID();
  332.             }
  333.  
  334.             ButtonObject subList = tempList.getSubButtons();
  335.             if (Event.compareTo(ResourceBundle.getBundle("DynaButtonsComp").getString("Number_Sub_Buttons") + " " + i) == 0) {
  336.                return Integer.toString(this.countButtons(subList));
  337.             }
  338.  
  339.             subList = subList.getNext();
  340.  
  341.             for(int j = 1; subList != null; ++j) {
  342.                if (Event.compareTo(this.indent + ResourceBundle.getBundle("DynaButtonsComp").getString("Sub_Button") + " " + i + "," + j) == 0) {
  343.                   return subList.getID();
  344.                }
  345.  
  346.                subList = subList.getNext();
  347.             }
  348.  
  349.             tempList = tempList.getNext();
  350.          }
  351.       } else {
  352.          if (Event.compareTo(ResourceBundle.getBundle("DynaButtonsComp").getString("Orientation")) == 0) {
  353.             if (Value.compareTo("0") == 0) {
  354.                this.Orientation = ResourceBundle.getBundle("DynaButtonsComp").getString("Horizontal");
  355.             } else {
  356.                this.Orientation = ResourceBundle.getBundle("DynaButtonsComp").getString("Vertical");
  357.             }
  358.  
  359.             this.debug("\r\nrandom:");
  360.             this.checkList(this.buttonList);
  361.             this.modifyImageSize();
  362.          } else if (Event.compareTo(ResourceBundle.getBundle("DynaButtonsComp").getString("Number_of_Buttons")) == 0) {
  363.             int nBtn = Integer.parseInt(Value, 10);
  364.             if (nBtn > 0) {
  365.                int NumButtons = nBtn;
  366.                if (nBtn > 20) {
  367.                   NumButtons = 20;
  368.                }
  369.  
  370.                this.modifyNumButtons(NumButtons, this.buttonList);
  371.                this.modifyImageSize();
  372.             }
  373.          } else {
  374.             ButtonObject tempList = this.buttonList.getNext();
  375.  
  376.             for(int i = 1; tempList != null; ++i) {
  377.                if (Event.compareTo(ResourceBundle.getBundle("DynaButtonsComp").getString("Button") + " " + i) == 0) {
  378.                   if (tempList.getSubButtonsExist()) {
  379.                      tempList.setText(Value);
  380.                   } else {
  381.                      tempList.setID(Value);
  382.                      tempList.setText(this.assMan.GetAssetName(Integer.parseInt(Value, 10)));
  383.                   }
  384.                } else if (Event.compareTo(ResourceBundle.getBundle("DynaButtonsComp").getString("Use_Sub_Buttons") + " " + i) == 0) {
  385.                   if (Value.compareTo("0") == 0) {
  386.                      tempList.setSubButtonsExist(true);
  387.                      if (insp != null) {
  388.                         insp.OnPropertyChanged(-1);
  389.                      }
  390.                   } else {
  391.                      tempList.setSubButtonsExist(false);
  392.                      if (insp != null) {
  393.                         insp.OnPropertyChanged(-1);
  394.                      }
  395.                   }
  396.  
  397.                   this.modifyImageSize();
  398.                } else if (Event.compareTo(ResourceBundle.getBundle("DynaButtonsComp").getString("Number_Sub_Buttons") + " " + i) == 0) {
  399.                   int NumButtons = Integer.parseInt(Value, 10);
  400.                   if (NumButtons > 20) {
  401.                      NumButtons = 20;
  402.                   }
  403.  
  404.                   this.modifyNumButtons(NumButtons, tempList.getSubButtons());
  405.                   this.modifyImageSize();
  406.                } else {
  407.                   ButtonObject subList = tempList.getSubButtons().getNext();
  408.  
  409.                   for(int j = 1; subList != null; ++j) {
  410.                      if (Event.compareTo(this.indent + ResourceBundle.getBundle("DynaButtonsComp").getString("Sub_Button") + " " + i + "," + j) == 0) {
  411.                         subList.setID(Value);
  412.                         subList.setText(this.assMan.GetAssetName(Integer.parseInt(Value, 10)));
  413.                      }
  414.  
  415.                      subList = subList.getNext();
  416.                   }
  417.                }
  418.  
  419.                tempList = tempList.getNext();
  420.             }
  421.          }
  422.  
  423.          this.SetPropertyValues();
  424.       }
  425.  
  426.       return "";
  427.    }
  428.  
  429.    protected void RemoveAssets() {
  430.       if (this.upID != 0) {
  431.          this.assMan.RemoveAsset(this.upID);
  432.          this.assMan.RemoveAsset(this.downID);
  433.       }
  434.  
  435.       if (this.backID != 0) {
  436.          this.assMan.RemoveAsset(this.backID);
  437.       }
  438.  
  439.    }
  440.  
  441.    protected void RemoveOneAsset(String assetIDStr) {
  442.       int assetID = Integer.parseInt(assetIDStr, 10);
  443.       if (assetID != 0) {
  444.          this.assMan.RemoveAsset(assetID);
  445.       }
  446.  
  447.    }
  448.  
  449.    private void setAllUrls(int context) {
  450.       ButtonObject tempList = this.buttonList.getNext();
  451.  
  452.       for(int i = 1; tempList != null; ++i) {
  453.          int assetID = Integer.parseInt(tempList.getID(), 10);
  454.          String theURL = this.assMan.GetAssetRelativeLocation(assetID, context, 1);
  455.          String theTarget = this.assMan.GetTargetFromLink(assetID);
  456.          tempList.setURL(theURL);
  457.          tempList.setTarget(theTarget);
  458.          if (tempList.getSubButtonsExist()) {
  459.             ButtonObject subList = tempList.getSubButtons().getNext();
  460.  
  461.             for(int j = 1; subList != null; ++j) {
  462.                int subAssetID = Integer.parseInt(subList.getID(), 10);
  463.                String subURL = this.assMan.GetAssetRelativeLocation(subAssetID, context, 1);
  464.                String subTarget = this.assMan.GetTargetFromLink(subAssetID);
  465.                subList.setURL(subURL);
  466.                subList.setTarget(subTarget);
  467.                subList = subList.getNext();
  468.             }
  469.          }
  470.  
  471.          tempList = tempList.getNext();
  472.       }
  473.  
  474.    }
  475.  
  476.    void SetPropertyValues() {
  477.       this.theJavaApplet.ResetParams();
  478.       if (this.Orientation == ResourceBundle.getBundle("DynaButtonsComp").getString("Vertical")) {
  479.          this.theJavaApplet.AddParam("Orientation", "String", "Vertical");
  480.       } else {
  481.          this.theJavaApplet.AddParam("Orientation", "String", "Horizontal");
  482.       }
  483.  
  484.       this.theJavaApplet.AddParam("ButtonImage", "String", this.paramButtonImage);
  485.       this.theJavaApplet.AddParam("HighliteImage", "String", this.paramHighliteImage);
  486.       this.theJavaApplet.AddParam("TextJustification", "String", Integer.toString(this.textJustification));
  487.       this.theJavaApplet.AddParam("TextAlignment", "String", Integer.toString(this.textAlignment));
  488.       this.theJavaApplet.AddParam("ButtonFont", "String", this.buttonFont);
  489.       this.theJavaApplet.AddParam("FontSize", "String", Integer.toString(this.fontSize));
  490.       this.theJavaApplet.AddParam("FontColor", "String", Integer.toString(this.fontColor));
  491.       this.theJavaApplet.AddParam("HighliteFontColor", "String", Integer.toString(this.highliteFontColor));
  492.       if (this.bold) {
  493.          this.theJavaApplet.AddParam("Bold", "String", "True");
  494.       }
  495.  
  496.       if (this.italic) {
  497.          this.theJavaApplet.AddParam("Italic", "String", "True");
  498.       }
  499.  
  500.       if (this.backgroundStyle == 1) {
  501.          this.theJavaApplet.AddParam("BackgroundColor", "String", Integer.toString(this.backgroundColor));
  502.       } else if (this.backgroundStyle == 2) {
  503.          this.theJavaApplet.AddParam("BackgroundImage", "String", this.paramBackgroundImage);
  504.       }
  505.  
  506.       ButtonObject tempList = this.buttonList.getNext();
  507.  
  508.       for(int i = 0; tempList != null; ++i) {
  509.          if (tempList.getSubButtonsExist()) {
  510.             if (tempList.getText().compareTo("") == 0) {
  511.                this.theJavaApplet.AddParam("ButtonText" + i, "String", " ");
  512.             } else {
  513.                this.theJavaApplet.AddParam("ButtonText" + i, "String", tempList.getText());
  514.             }
  515.  
  516.             ButtonObject subList = tempList.getSubButtons().getNext();
  517.  
  518.             for(int j = 0; subList != null; ++j) {
  519.                if (subList.getText().compareTo("") == 0) {
  520.                   this.theJavaApplet.AddParam("ButtonText" + i + "_" + j, "String", " ");
  521.                   this.theJavaApplet.AddParam("URL" + i + "_" + j, "String", " ");
  522.                   this.theJavaApplet.AddParam("Target" + i + "_" + j, "String", " ");
  523.                } else {
  524.                   subList.setText(this.assMan.GetAssetName(Integer.parseInt(subList.getID(), 10)));
  525.                   this.theJavaApplet.AddParam("ButtonText" + i + "_" + j, "String", subList.getText());
  526.                   this.theJavaApplet.AddParam("URL" + i + "_" + j, "String", subList.getURL());
  527.                   this.theJavaApplet.AddParam("Target" + i + "_" + j, "String", subList.getTarget());
  528.                }
  529.  
  530.                subList = subList.getNext();
  531.             }
  532.          } else {
  533.             if (tempList.getText().compareTo("") == 0) {
  534.                this.theJavaApplet.AddParam("ButtonText" + i, "String", " ");
  535.             } else {
  536.                String buttonText = this.assMan.GetAssetName(Integer.parseInt(tempList.getID(), 10));
  537.                this.theJavaApplet.AddParam("ButtonText" + i, "String", buttonText);
  538.             }
  539.  
  540.             this.theJavaApplet.AddParam("URL" + i, "String", tempList.getURL());
  541.             this.theJavaApplet.AddParam("Target" + i, "String", tempList.getTarget());
  542.          }
  543.  
  544.          tempList = tempList.getNext();
  545.       }
  546.  
  547.    }
  548.  
  549.    private void updateSiteLook(int context) {
  550.       DLayout layout = this.theJavaApplet.getLayout();
  551.       DSite site = layout.getSite();
  552.       DStyle style = site.getCurrentStyle();
  553.       this.RemoveAssets();
  554.       this.backgroundStyle = layout.getBackgroundStyle();
  555.       if (this.backgroundStyle != 0) {
  556.          if (this.backgroundStyle == 1) {
  557.             this.backgroundColor = layout.getBackgroundColor();
  558.          } else if (this.backgroundStyle == 2) {
  559.             this.backID = this.assMan.AddAsset(layout.getBackgroundImage(), "Image", "");
  560.             this.backgroundImage = this.assMan.GetAssetRelativeLocation(this.backID, context, 1);
  561.          }
  562.       } else {
  563.          this.backgroundStyle = style.getBackgroundStyle();
  564.          if (this.backgroundStyle == 1) {
  565.             this.backgroundColor = style.getBackgroundColor();
  566.          } else if (this.backgroundStyle == 2) {
  567.             this.backID = this.assMan.AddAsset(style.getBackgroundImage(), "Image", ResourceBundle.getBundle("DynaButtonsComp").getString("Component_Name"));
  568.             this.backgroundImage = this.assMan.GetAssetRelativeLocation(this.backID, context, 1);
  569.          }
  570.       }
  571.  
  572.       this.textJustification = 5;
  573.       this.textAlignment = style.getButtonTextAlign();
  574.       this.fontColor = style.getButtonFontColor();
  575.       this.highliteFontColor = style.getButtonDownFontColor();
  576.       DFont font = style.getButtonFont();
  577.       this.buttonFont = font.getName();
  578.       this.fontSize = font.getPoint();
  579.       this.bold = font.getBold();
  580.       this.italic = font.getItalic();
  581.       String buttonUp = style.getButtonUpImage();
  582.       if (buttonUp == null || buttonUp.compareTo("") == 0) {
  583.          buttonUp = this.field_0 + "transButton.gif";
  584.       }
  585.  
  586.       String buttonDown = style.getButtonDownImage();
  587.       if (buttonDown == null || buttonDown.compareTo("") == 0) {
  588.          buttonDown = this.field_0 + "transButton.gif";
  589.       }
  590.  
  591.       this.upID = this.assMan.AddAsset(buttonUp, "Image", ResourceBundle.getBundle("DynaButtonsComp").getString("Component_Name"));
  592.       this.downID = this.assMan.AddAsset(buttonDown, "Image", ResourceBundle.getBundle("DynaButtonsComp").getString("Component_Name"));
  593.       this.ButtonImage = this.assMan.GetAssetRelativeLocation(this.upID, context, 1);
  594.       this.HighliteImage = this.assMan.GetAssetRelativeLocation(this.downID, context, 1);
  595.       DSize buttonSize = style.getButtonSize();
  596.       if (buttonSize != null) {
  597.          this.imgX = buttonSize.getWidth();
  598.          this.imgY = buttonSize.getHeight();
  599.       } else {
  600.          this.imgX = 100;
  601.          this.imgY = 35;
  602.       }
  603.  
  604.       this.modifyImageSize();
  605.    }
  606. }
  607.